//
//  ArticleItemCell.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/10/16.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "CommonItemCell.h"

#import "ArticleListData.h"

@interface CommonItemCell ()

/// viewModle
@property (nonatomic, readwrite, strong) CommonItemViewModel *viewModel;

/// IBOutlet
@property (weak, nonatomic) IBOutlet UILabel* titleLabel;
@property (weak, nonatomic) IBOutlet UILabel* tagLabel;
@property (weak, nonatomic) IBOutlet UILabel* timeLabel;
@property (weak, nonatomic) IBOutlet UIImageView* aImgView;

@end

@implementation CommonItemCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

#pragma mark - bind data
- (void)bindViewModel:(CommonItemViewModel *)viewModel
{
    self.viewModel = viewModel;
    
    ArticleListData* data = viewModel.data;
    
//    NSDateFormatter* format = [[NSDateFormatter alloc] init];
//    [format setDateFormat:@"MM-dd"];
//    NSDate *fromdate = [format dateFromString:data.addTime];
//    NSString* strAddTime = [fromdate mh_string_yyyy_MM_dd];
    
    self.titleLabel.text = data.title;
    self.tagLabel.text = data.from;
    self.timeLabel.text = data.addTime;
//    [self.aImgView yy_setImageWithURL:[NSURL URLWithString:curUserData.icon] placeholder:MHImageNamed(@"placeholderLogo")];
}

@end
